// 李嘉怡的代码
/*切换账号的操作！！！！ */
var toontherzh = document.getElementById("toontherzh");
var morezhcover = document.getElementById("morezhcover");
var morezh = document.getElementById("morezh");
toontherzh.onclick = function () {
    morezhcover.style.display = "block";
    morezh.style.display = "block";
}

var closemorezh = document.getElementById("closemorezh");
closemorezh.onclick = function () {
    morezhcover.style.display = "none";
    morezh.style.display = "none";
}
var nomore = document.getElementById("nomore");
nomore.onclick = function () {
    morezhcover.style.display = "none";
    morezh.style.display = "none";
}

/*vip充值服务类型！！！ */
var allwaysdivs = document.getElementById("hhh").querySelectorAll("div");
var allwaysbuttons = document.getElementById("hhh").querySelectorAll("button");
var words = document.getElementById("words");
var money = document.getElementById("money");
/*循环遍历这几个div */
for (let i = 0; i < allwaysdivs.length; i++) {
    allwaysdivs[i].onclick = function () {
        for (let i = 0; i < allwaysdivs.length; i++) {
            allwaysdivs[i].style.background = "none";
            allwaysbuttons[i].style.background = "none";
        }
        allwaysbuttons[i].style.background = "linear-gradient(120deg,#fff7ec,#ffcb7e)";
        allwaysdivs[i].style.background = "linear-gradient(120deg,#fff7ec,#ffcb7e)";
        if (i == 0) {
            words.innerHTML = "到期将按每年218元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
            money.innerHTML = "218.00";
        } else if (i == 1) {
            words.innerHTML = "到期将按每季58元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
            money.innerHTML = "35.00";
        } else if (i == 2) {
            words.innerHTML = "到期将按每月19元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
            money.innerHTML = "12.00";
        } else if (i == 3) {
            words.innerHTML = "到期将按每月20元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
            money.innerHTML = "248.00";
        } else if (i == 4) {
            words.innerHTML = "到期将按每月24元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
            money.innerHTML = "68.00";
        } else {
            words.innerHTML = "到期将按每月25元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
            money.innerHTML = "25.00";
        }
    }
}


/*轮播图 */
var btn = document.getElementById("btn");
var hhh = document.getElementById("hhh");
var leftbtn = document.getElementById("leftbtn");
btn.onclick = function () {
    hhh.style.marginLeft = "-645px";
    hhh.style.transition = "all 1s";
    btn.style.display = "none";
    leftbtn.style.display = "block";
}
leftbtn.onclick = function () {
    hhh.style.marginLeft = "0px";
    hhh.style.transition = "all 1s";
    btn.style.display = "block";
    leftbtn.style.display = "none";
}


/*导航栏头像下拉栏 */
var showhide = document.getElementById("showhide");
var headimgHide = document.getElementById("headimgHide");

showhide.onclick = function () {
    if (headimgHide.style.display == "none") {
        headimgHide.style.display = "block";
    } else {
        headimgHide.style.display = "none"
    }
}




/*邮箱注册 */
var emailregister = document.getElementById("emailregister")//邮箱注册
// var changepassword = document.getElementById("changepassword");//忘记密码
var emailpasswordlogin = document.getElementById("emailpasswordlogin");//邮箱密码登录
var selfaccountregister = document.getElementById("selfaccountregister");//自定义账号注册
var emailcodelogin = document.getElementById("emailcodelogin");//邮箱验证码登录
var selfaccountlogin = document.getElementById("selfaccountlogin");//自定义账号登录

var emailcodeloginthere = document.getElementById("emailcodeloginthere");//邮箱验证码登录
var selfaccountregisterthere = document.getElementById("selfaccountregisterthere");//自定义账户注册
var selfaccountloginthere = document.getElementById("selfaccountloginthere");//自定义账号登录
var loginthrer = document.getElementById("loginthrer");//邮箱密码登录
var registerthere = document.getElementById("registerthere");//邮箱注册

emailregister.onclick = function () {
    emailregister.style.color = "#16e09d";
    emailpasswordlogin.style.color = "black";
    changepassword.style.color = "black";
    selfaccountregister.style.color = "black";
    emailcodelogin.style.color = "black";
    selfaccountlogin.style.color = "black";
    loginthrer.style.display = "none";
    registerthere.style.display = "block";
    emailcodeloginthere.style.display = "none";
    selfaccountregisterthere.style.display = "none";
    selfaccountloginthere.style.display = "none";
}
/*邮箱密码登录 */

emailpasswordlogin.onclick = function () {
    loginthrer.style.display = "block";
    // newpasswordthere.style.display = "none";
    registerthere.style.display = "none";
    emailcodeloginthere.style.display = "none";
    selfaccountregisterthere.style.display = "none";
    selfaccountloginthere.style.display = "none";

    emailregister.style.color = "black";
    emailpasswordlogin.style.color = "#16e09d";
    // changepassword.style.color = "black";
    selfaccountregister.style.color = "black";
    emailcodelogin.style.color = "black";
    selfaccountlogin.style.color = "black";

}
/*邮箱验证码登录 */

emailcodelogin.onclick = function () {
    loginthrer.style.display = "block";
    // newpasswordthere.style.display = "none";
    registerthere.style.display = "none";
    emailcodeloginthere.style.display = "none";
    selfaccountregisterthere.style.display = "none";
    selfaccountloginthere.style.display = "none";
    emailregister.style.color = "black";
    emailpasswordlogin.style.color = "black";
    // changepassword.style.color = "black";
    selfaccountregister.style.color = "black";
    emailcodelogin.style.color = "#16e09d";
    selfaccountlogin.style.color = "black";
}

selfaccountregister.onclick = function () {
    loginthrer.style.display = "none";
    // newpasswordthere.style.display = "none";
    registerthere.style.display = "none";
    emailcodeloginthere.style.display = "none";
    selfaccountregisterthere.style.display = "block";
    selfaccountloginthere.style.display = "none";
    emailregister.style.color = "black";
    emailpasswordlogin.style.color = "black";
    // changepassword.style.color = "black";
    selfaccountregister.style.color = "#16e09d";
    emailcodelogin.style.color = "black";
    selfaccountlogin.style.color = "black";
}

selfaccountlogin.onclick = function () {
    loginthrer.style.display = "none";
    registerthere.style.display = "none";
    emailcodeloginthere.style.display = "none";
    selfaccountregisterthere.style.display = "none";
    selfaccountloginthere.style.display = "block";
    emailregister.style.color = "black";
    emailpasswordlogin.style.color = "black";
  
    selfaccountregister.style.color = "black";
    emailcodelogin.style.color = "black";
    selfaccountlogin.style.color = "#16e09d";
}

/*获取验证码的定时器操作！！！！ */
var getyzm = document.getElementById("getyzm");
getyzm.onclick = function () {

}




/*登录更改密码的弹窗的消失 */
var closelogintc = document.querySelectorAll(".closelogintc");
for (let i = 0; i < closelogintc.length; i++) {
    closelogintc[i].onclick = function () {
        headimgHide.style.display = "none";
        logincover.style.display = "none";
        loginmodal.style.display = "none";
    }
}


/*登录  退出的操作！！！！ */
var tologin = document.getElementById("tologin");
tologin.onclick = function () {
    headimgHide.style.display = "none";
    logincover.style.display = "block";
    loginmodal.style.display = "block";
}

/*开通vip进行切换新帐号的操作    实际上就是退出然后仍然显示登录vip的地方之后再显示登录的地方！！！ */
var changeqq = document.getElementById("changeqq");
changeqq.onclick = function () {
    /*退出的操作！！！ */

    /*显示登录的弹窗 */
    cover.style.display = "none";
    modal.style.display = "none";


    logincover.style.display = "block";
    loginmodal.style.display = "block";
}




/*导航栏头像隐藏下拉栏的开通会员 */
var hidebutton = document.getElementById("hidebutton");
hidebutton.onclick = function () {
    /*点开隐藏框的时候直接隐藏下拉栏 */
    headimgHide.style.display = "none";
    cover.style.display = "block";   //显示遮罩层
    modal.style.display = "block";   //显示弹出层
    var wlcover = document.getElementById("wlcover");
    var wl = document.getElementById("wl");
    closes.onclick = function () {
        /*出现一个挽留的弹窗！！！！ */
        wlcover.style.display = "block";   //显示遮罩层
        wl.style.display = "block";   //显示弹出层
        var yesclose = document.getElementById("yesclose");
        var noclose = document.getElementById("noclose");
        yesclose.onclick = function () {
            cover.style.display = "none";
            modal.style.display = "none";
            wlcover.style.display = "none";   //显示遮罩层
            wl.style.display = "none";   //显示弹出层
        }
        noclose.onclick = function () {
            wlcover.style.display = "none";   //显示遮罩层
            wl.style.display = "none";   //显示弹出层
        }
    }
}



